determine the intervals a function is increasing and decreasing and extrema using